module.exports = function (sequelize, DataTypes) {
    const AppletUser = sequelize.define('appletUser', {
        nickName: {
            type: DataTypes.STRING,
            comment: '用户名'
        },
        avatar: {
            type: DataTypes.STRING,
            comment: '用户头像'
        },
        openId: {
            type: DataTypes.STRING,
            //不允许为空
            allowNull: false,
            unique: true,
            comment: '支付宝小程序中的用户Id'
        }
    }, {
        timestamps: true, //createAt updateAt是否显示
        createdAt: "createdTime", // 将createdAt设为自定义字段createdTime
        updatedAt: "updatedTime",
        deletedAt: "deletedTime",
        paranoid: true,
    })

    return AppletUser
}
